feat(desktop): expose interrupted-turn auto-resume setting - #3642
feat(desktop): expose interrupted-turn auto-resume setting#3642PeaceMaker-best wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06593e8119
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/maker-host/interrupted-turn-auto-resume-store.ts | 将逐次磁盘读取迁移到带 mtime 缓存的原子 override store,但手动逃生门存在同时间戳编辑未被识别的边缘情况。 |
| apps/desktop/src/main/maker-ipc/autoResumeBookkeeping.ts | 新增只取消未触发退避 timer 的批量操作,并保留已进入异步执行阶段的 attempt。 |
| apps/desktop/src/main/maker-ipc/register.ts | 将新设置作为 interrupted-turn auto-resume 主门控,并在退避触发前再次热读配置。 |
| apps/desktop/src/main/bootstrap-electron.ts | 新增经可信 renderer 校验的设置 GET、SET、RESET IPC,关闭时同步取消等待排期。 |
| apps/desktop/src/renderer/hooks/useInterruptedTurnAutoResumeSettings.ts | 新增以主进程为权威来源的设置 hook,并防止延迟初读覆盖本地提交。 |
| apps/desktop/src/renderer/components/settings/WindowBehaviorSection.tsx | 在应用行为设置中加入跨平台自动续跑开关和恢复默认控件。 |
Sequence Diagram
sequenceDiagram
participant U as 用户
participant R as Settings Renderer
participant P as Preload
participant M as Electron Main
participant S as Override Store
participant B as AutoResumeBookkeeping
U->>R: 关闭自动续跑
R->>P: interruptedTurnAutoResumeSet(false)
P->>M: 固定 IPC channel
M->>M: 校验可信 sender 与布尔参数
M->>S: "原子写入 enabled=false"
M->>B: cancelWaitingSchedules()
B->>B: 取消未触发 timer 并恢复被压制错误
M-->>R: 返回权威设置状态
Prompt To Fix All With AI
### Issue 1
apps/desktop/src/main/maker-host/interrupted-turn-auto-resume-store.ts:59-60
**mtime 缓存削弱手动逃生门**
如果用户或自动化程序在文件系统时间戳粒度内原地修改配置,`invalidateIfChanged()` 会继续使用旧缓存,导致写入的 `enabled: false` 无法立即阻止下一次自动续跑。现有测试通过主动将 mtime 推后两秒避开了这一情况;建议改为不依赖 mtime 唯一识别内容变化,或明确采用能够保证变更版本递增的机制。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(desktop): expose interrupted-turn a..." | Re-trigger Greptile
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a6a7750d6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@PeaceMaker-best 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/main/bootstrap-electron.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
这条 PR 新增了用户可改的「中断回合自动继续」设置,属于产品方向,先进入维护者确认,不会自动合并。 请维护者在 PR 上 Approve 放行;要改就 Request Changes。讨论 issue:#3644 |
|
命中 UI 路径(apps/desktop/src/renderer/components/settings/WindowBehaviorSection.tsx / apps/desktop/src/renderer/hooks/useInterruptedTurnAutoResumeSettings.ts)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范。 |
Signed-off-by: PeaceMaker-best <221849497+PeaceMaker-best@users.noreply.github.com>
Signed-off-by: PeaceMaker-best <221849497+PeaceMaker-best@users.noreply.github.com>
Signed-off-by: PeaceMaker-best <221849497+PeaceMaker-best@users.noreply.github.com>
3a6a775 to
6ca5ee2
Compare
|
已按 UI evidence notice 补充 PR description:新增最终设置行的 HTML 效果证据,分别展示默认开启态与用户关闭后的「已自定义 + 恢复默认」态,并明确标注这不是 Electron 真机截图。证据使用与最终组件一致的卡片尺寸、Switch/override 控件结构和 theme token;Light/Dark 仍如实标为未做目视验证。 |
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@MagicLizi #3644 列出的技术放行条件现已全部收口:mtime 同时间戳内容变更问题已修复并补回归测试, |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ca5ee2eed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@PeaceMaker-best 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/renderer/i18n/locales/en/common.json),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
Signed-off-by: PeaceMaker-best <221849497+PeaceMaker-best@users.noreply.github.com>
|
@PeaceMaker-best 👋 这个 PR 目前与 请在本地 merge 最新的 |
这次改了什么
摘要
把已有的 interrupted-turn auto-resume 隐藏开关正式放进「设置 → 应用行为」。默认行为保持不变(开启);用户可关闭并恢复默认值。
关闭后只撤销仍在退避等待中的自动继续,并恢复原错误供用户手动处理;已经开始分类或派发的续跑不会被中途终止。该开关不改变 provider/SDK 自身的请求重试,也不影响 silent-stop auto-resume。设置持久化失败时,底层文件系统异常只记录在 Main 日志,Renderer 仅收到不含本机路径的稳定 IPC 错误。
变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
UI 变化
docs/design-rules/DESIGN.md§4 Component Stylings(复用现有 Settings 卡片、Switch 和 DefaultOverrideControls);§10 Theme System & Token Reference(只使用现有 theme token,无 raw color,自动继承 Light/Dark 与自定义主题);§11 Voice & Content(zh-CN / zh-TW / en / ja / ko 同步,英文标题使用 Title Case);§14 Interaction Conventions(沿用 Switch 的 focus/disabled/transition,不新增动效)。Light/Dark 未做目视验证,未声称已验证。界面效果证据(HTML)
怎么验证的
自动验证
手工验证
未启动 Electron;提供了按最终组件结构整理的 HTML 界面证据。逻辑、IPC sender fence、错误净化、store 与 renderer 交互均由自动测试覆盖。
未执行的验证
pnpm --filter desktop lint在当前 main 的存量 lint 基线上失败(446 errors / 5 warnings)。本 PR 新增文件及除register.ts外的相关改动文件定向 lint 通过;register.ts只命中 6 个本 PR 未触及的存量 unused 报告。风险
风险分类
影响与回滚
提交前检查
git commit -s)